<?php


namespace app\api\controller\xiluedu;


use app\common\controller\Api;
use app\common\model\xiluedu\Config AS ConfigModel;

class Config extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    public function config() {
        $name = $this->request->param('name',null);
        $config = ConfigModel::getMyConfig($name);
        $this->success('查询成功',$config);
    }

    public function get_image(){
        $field = $this->request->param('field',null);
        $name = $this->request->param('name',null);
        $config = ConfigModel::getMyConfig($name);
        $image = isset($config[$field]) ? $config[$field] : '';
        $this->success('查询成功',['image'=>cdnurl($image,true)]);
    }

}